<script src="js/Calendar.js" type="text/javascript"></script>
<script type="text/javascript" src="js/global/Date_func.js"></script>
<link rel="stylesheet" type="text/css" href="css/member.css"/>
<style>

	.report{margin:10px 0; padding:15px; border:1px solid #eee}
	.report span.part{ margin-right:20px;}
	input.time{    background: url("images/rili.png") no-repeat scroll right center #FFFFFF;
    border: 1px solid #7F9DB9;
    height: 20px;
    line-height: 20px;
    width: 150px;}
	.total{ width:100%; text-align:center;}
	input.checkbox{ vertical-align:-2px; margin-right:2px;}
	.btn{ background:#eee; padding:4px 15px; *padding:4px 8px; background:url("images/mc_title.png") no-repeat right top; color:#fff; border:none; cursor:pointer}
	#excel{margin-left:10px;}
</style>
<h3 class="mc_title">
	<span class="mctit_1 notcur">
		<a href="orderReport.html"><span class="mctit_2">已卖出产品报表</span></a>
	</span>
	<?if($_a->checkAuth("buyOrderReport.html")){?>
	<span class="mctit_1 <?=($from=="buy")?"":"notcur"?>">
		<a href="buyOrderReport.html"><span class="mctit_2">已买到产品报表</span></a>
	</span>
	<?}else if($_SERVER['SCRIPT_URI']== 'http://www.12301.cc/buyOrderReport.html'){
            exit;//没有权限看这个页面的人 (单纯的分销商) 还是可以通过输入网址到这里
    }
    if($_GET['alli']){
    ?>
    <span class="mctit_1 <?=($from=="alliance")?"":"notcur"?>">
		<a href="allianceOrderReport.html"><span class="mctit_2">已卖出联盟产品报表</span></a>
	</span>
    <?}?>
	<span class="mctit_1"> 
		<a href="orderReport_Compass.html"><span class="mctit_2">数据罗盘</span></a>
	</span>
</h3> 
<iframe src="http://www.12301.cc/tpl/zbar2.html" width="100%" height="700px" style="border:0"> </iframe>
<iframe src="http://www.12301.cc/tpl/zpie2.html" width="100%" height="700px" style="border:0"> </iframe>
<iframe src="http://www.12301.cc/module/zax/baiduline/map_2/map5.html" width="100%" height="620px" scrolling="no"style="border:0"> </iframe>

<script src="js/jsorder.js"></script>
<script src="http://www.12301.cc/js/WdatePicker.js"></script>
<script>
	$("#time").change(function(){
		Date_func.selectDate($(this).val(),$("#begintime").get(0),$("#endtime").get(0));
	});
	$("input.btn").click(function(){
		var btime=$("#begintime").val();
		var etime=$("#endtime").val();
		btime=btime.split("-");
		etime=etime.split("-");
		month=(etime[0]-btime[0])*12+(etime[1]-btime[1]);
		if(month>3){
			alert("交易日期时间间隔不能超过三个月");
			return false;
		}
	});
	// 获取门票
	$("#land").change(function(){
		
		landid=$(this).val();
		if(landid==''){
			_options = '<option value="">--选择--</option>';
			$("#ticket").html(_options);
			return;
		}
		$.ajax({
			uri:window.location.href,
			data:"landid="+landid,
			beforeSend:function (XMLHttpRequest) {
				XMLHttpRequest.setRequestHeader("request_type","getTicket");
			},
			success: function(data){
				data = JSON.parse(data);
				if(data.s=='success'){
					_options = '<option value="">--选择--</option>';
					for(var i in data.content){
						_options+='<option value="'+data.content[i].id+'_'+data.content[i].title+'">'+data.content[i].title+'</option>';
					}
					$("#ticket").html(_options);

				}
			}
		});
	});
	
	$("#excel").click(function(){
		$("#act").val("orderReportExcel");
		$("form.report").submit();
		$("#act").val("");
	});
	
	function changeDate(date){
		// lastweek颠倒了
		if(date=='lastweek'){
			Date_func.selectDate(date,$("#endtime").get(0),$("#begintime").get(0));
		}else{
			Date_func.selectDate(date,$("#begintime").get(0),$("#endtime").get(0));
		}
	}

   

</script>